package dto

import (
	"net"
	"time"
)

type MemInfo struct {
	Total    float32 `json:"total"`
	Used     float32 `json:"used"`
	Free     float32 `json:"free"`
	UsedRate float32 `json:"used_rate"`
}

type CpuInfo struct {
	Cpu      int32   `json:"cpu"`
	Cores    int32   `json:"cores"`
	UsedRate float64 `json:"usedRate"`
}

//        sysInfo["diskInfo"].append({"serial":disk[0],"label":disk[1],"size": disk[2],"used":disk[3],"free": disk[4],"usedRate": disk[5]})

type DiskInfo struct {
	Device     string  `json:"device"`
	MountPoint string  `json:"mountPoint"`
	Path       string  `json:"path"`
	FsType     string  `json:"fsType"`
	Size       float64 `json:"size"`
	Used       float64 `json:"used"`
	Free       float64 `json:"free"`
	UsedRate   float64 `json:"usedRate"`
}
type SysInfo struct {
	Os            string `json:"os"`
	Hostname      string `json:"hostname"`
	KernelVersion string `json:"kernelVersion"`
	HardArch      string `json:"hardArch"`
	MemInfo       `json:"memInfo"`
	CpuInfo       []CpuInfo  `json:"cpuInfo"`
	DiskInfo      []DiskInfo `json:"diskInfo"`
	NetInfo       []NetInfo  `json:"netInfo"`
}
type NetInfo struct {
	Name string `json:"name"`
	Ip   string `json:"ip"`
	Mac  string `json:"mac"`
}

type ResponseDto struct {
	Success   bool                   `json:"success"`
	ErrorCode string                 `json:"errorCode"`
	ErrorMsg  string                 `json:"errorMsg"`
	Data      map[string]interface{} `json:"data"`
}
type ConnectionInfo struct {
	Conn        net.Conn
	LastSysInfo *SysInfo
	StartTime   time.Time
	EndTime     time.Time
}
